<%@page import="java.util.ArrayList"%>
<%@page import="database.ProductDAO"%>
<%@page import="model.Category"%>
<%@page import="java.util.List"%>
<%@page import="model.Role"%>
<%@page import="model.Staff"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<%
    Staff staff = (Staff) session.getAttribute("staff");

    if (staff == null) {
        response.sendRedirect(request.getContextPath() + "/Administration");
    } else if (!staff.getRoleList().contains(new Role(2))) {
        response.sendRedirect(request.getContextPath() + "/Administration/home");
    } else {
%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Upload Product Image</title>
         <link href="<%= request.getContextPath()%>/css/style_for_page.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_menu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_addtion.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/style_for_warehousing.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/adMenu.css" rel="stylesheet" type="text/css"/>
        <link href="<%= request.getContextPath()%>/css/tHeaderFooter.css" rel="stylesheet" type="text/css"/>
    </head>
    <body style="background-color: lightsteelblue;">
         <div class="headerbg">
            <div class="header"> 
                <%@include file="/include/mHeader.jsp" %>
            </div>
            <div class="adContent">
                <div class="adMenu">
                    <%@include file="/include/mMenu.jsp" %>
                </div>
            </div>
        </div>
                 <div class="contentbg">
                    <div class="content" >
                        </br>
                        </br>
                    <div class="registerForm">     
                      <s:form action="upload-file" method="post" enctype="multipart/form-data" theme="simple">  
                      <table style="text-align: left; margin-left: 10px;">
                            <tr>
                                <td>
                                    <h3> Select product image from your computer...  </h3>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <s:file  name="userImage" />
                                </td>
                            </tr>
                            <tr>
                                <td >
                                    <s:submit style="width: 100px;" value="Upload Image" align="center" theme="simple" />
                                </td>
                            </tr>
                        </table>
                            </s:form>     
                    </div>
                </div>
            </div>  
        <footer>
            <div id="footer">
         <%@include file="/include/iFooter.jsp" %>
    </div>   
        </footer>
        
    </body>
</html>
<%
    }
%>